package validation

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"net/http"
	"vueAdmin/application/utils"
)

type Login struct {
	Username string `form:"username"  binding:"required"`
	Password string `form:"password" binding:"required"`
}

func CheckLogin(c *gin.Context) bool {
	var login Login
	if err := c.ShouldBind(&login); err != nil {
		fmt.Println(err)
		c.JSON(http.StatusOK, utils.SetPackageData(1001, nil))
		return false
	}
	return true

}
